home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1992 June: ROMin Holiday / ADC Developer CD (1992-06) (''ROMin Holiday'')_iso / Developer Connection - 06-1992.iso / Developer Essentials / MPW Interfaces & Libraries / CIncludes / Menus.h < prev    next >
Encoding:
C/C++ Source or Header  |  1992-01-29  |  5.2 KB  |  194 lines  |  [TEXT/MPS ]

  1.  
  2. /************************************************************
  3.  
  4. Created: Tuesday, September 17, 1991 at 1:56 PM
  5.  Menus.h
  6.  C Interface to the Macintosh Libraries
  7.  
  8.  
  9.   Copyright Apple Computer, Inc. 1985-1991
  10.   All rights reserved
  11.  
  12. ************************************************************/
  13.  
  14.  
  15. #ifndef __MENUS__
  16. #define __MENUS__
  17.  
  18. #ifndef __QUICKDRAW__
  19. #include <Quickdraw.h>
  20. #endif
  21.  
  22.  
  23. enum {
  24.  
  25.  
  26. #define noMark '\0'        /*mark symbol for MarkItem*/
  27.  
  28. /* menu defProc messages */
  29.  
  30.  mDrawMsg = 0,
  31.  mChooseMsg = 1,
  32.  mSizeMsg = 2,
  33.  mDrawItemMsg = 4,
  34.  mCalcItemMsg = 5,
  35.  textMenuProc = 0,
  36.  hMenuCmd = 27,            /*itemCmd == 0x001B ==> hierarchical menu*/
  37.  hierMenu = -1,            /*a hierarchical menu - for InsertMenu call*/
  38.  mPopUpMsg = 3,            /*menu defProc messages - place yourself*/
  39.  mctAllItems = -98,        /*search for all Items for the given ID*/
  40.  mctLastIDIndic = -99    /*last color table entry has this in ID field*/
  41. };
  42.  
  43. struct MenuInfo {
  44.  short menuID;
  45.  short menuWidth;
  46.  short menuHeight;
  47.  Handle menuProc;
  48.  long enableFlags;
  49.  Str255 menuData;
  50. };
  51.  
  52. typedef struct MenuInfo MenuInfo;
  53. typedef MenuInfo *MenuPtr, **MenuHandle;
  54.  
  55. struct MCEntry {
  56.  short mctID;            /*menu ID.  ID = 0 is the menu bar*/
  57.  short mctItem;            /*menu Item. Item = 0 is a title*/
  58.  RGBColor mctRGB1;        /*usage depends on ID and Item*/
  59.  RGBColor mctRGB2;        /*usage depends on ID and Item*/
  60.  RGBColor mctRGB3;        /*usage depends on ID and Item*/
  61.  RGBColor mctRGB4;        /*usage depends on ID and Item*/
  62.  short mctReserved;        /*reserved for internal use*/
  63. };
  64.  
  65. typedef struct MCEntry MCEntry;
  66. typedef MCEntry *MCEntryPtr;
  67.  
  68.  
  69. typedef MCEntry MCTable[1], *MCTablePtr, **MCTableHandle;
  70.  
  71.  
  72.  
  73.  
  74.  
  75.  
  76.  
  77. struct MenuCRsrc {
  78.  short numEntries;        /*number of entries*/
  79.  MCTable mcEntryRecs;    /*ARRAY [1..numEntries] of MCEntry*/
  80. };
  81.  
  82. typedef struct MenuCRsrc MenuCRsrc;
  83. typedef MenuCRsrc *MenuCRsrcPtr, **MenuCRsrcHandle;
  84.  
  85.  
  86. #ifdef __cplusplus
  87. extern "C" {
  88. #endif
  89. pascal void InitMenus(void)
  90.  = 0xA930; 
  91. pascal MenuHandle NewMenu(short menuID,const Str255 menuTitle)
  92.  = 0xA931; 
  93. pascal MenuHandle GetMenu(short resourceID)
  94.  = 0xA9BF; 
  95. pascal void DisposeMenu(MenuHandle theMenu)
  96.  = 0xA932; 
  97. pascal void AppendMenu(MenuHandle menu,ConstStr255Param data)
  98.  = 0xA933; 
  99. pascal void AddResMenu(MenuHandle theMenu,ResType theType)
  100.  = 0xA94D; 
  101. pascal void InsertResMenu(MenuHandle theMenu,ResType theType,short afterItem)
  102.  = 0xA951; 
  103. pascal void InsertMenu(MenuHandle theMenu,short beforeID)
  104.  = 0xA935; 
  105. pascal void DrawMenuBar(void)
  106.  = 0xA937; 
  107. pascal void InvalMenuBar(void)
  108.  = 0xA81D; 
  109. pascal void DeleteMenu(short menuID)
  110.  = 0xA936; 
  111. pascal void ClearMenuBar(void)
  112.  = 0xA934; 
  113. pascal Handle GetNewMBar(short menuBarID)
  114.  = 0xA9C0; 
  115. pascal Handle GetMenuBar(void)
  116.  = 0xA93B; 
  117. pascal void SetMenuBar(Handle menuList)
  118.  = 0xA93C; 
  119. pascal void InsMenuItem(MenuHandle theMenu,ConstStr255Param itemString,
  120.  short afterItem)
  121.  = 0xA826; 
  122. pascal void DelMenuItem(MenuHandle theMenu,short item)
  123.  = 0xA952; 
  124. pascal long MenuKey(short ch)
  125.  = 0xA93E; 
  126. pascal void HiliteMenu(short menuID)
  127.  = 0xA938; 
  128. pascal void SetItem(MenuHandle theMenu,short item,ConstStr255Param itemString)
  129.  = 0xA947; 
  130. pascal void GetItem(MenuHandle theMenu,short item,Str255 itemString)
  131.  = 0xA946; 
  132. pascal void DisableItem(MenuHandle theMenu,short item)
  133.  = 0xA93A; 
  134. pascal void EnableItem(MenuHandle theMenu,short item)
  135.  = 0xA939; 
  136. pascal void CheckItem(MenuHandle theMenu,short item,Boolean checked)
  137.  = 0xA945; 
  138. pascal void SetItemMark(MenuHandle theMenu,short item,short markChar)
  139.  = 0xA944; 
  140. pascal void GetItemMark(MenuHandle theMenu,short item,short *markChar)
  141.  = 0xA943; 
  142. pascal void SetItemIcon(MenuHandle theMenu,short item,short iconIndex)
  143.  = 0xA940; 
  144. pascal void GetItemIcon(MenuHandle theMenu,short item,short *iconIndex)
  145.  = 0xA93F; 
  146. pascal void SetItemStyle(MenuHandle theMenu,short item,short chStyle)
  147.  = 0xA942; 
  148. pascal void GetItemStyle(MenuHandle theMenu,short item,Style *chStyle); 
  149. pascal void CalcMenuSize(MenuHandle theMenu)
  150.  = 0xA948; 
  151. pascal short CountMItems(MenuHandle theMenu)
  152.  = 0xA950; 
  153. pascal MenuHandle GetMHandle(short menuID)
  154.  = 0xA949; 
  155. pascal void FlashMenuBar(short menuID)
  156.  = 0xA94C; 
  157. pascal void SetMenuFlash(short count)
  158.  = 0xA94A; 
  159. pascal long MenuSelect(Point startPt)
  160.  = 0xA93D; 
  161. pascal void InitProcMenu(short resID)
  162.  = 0xA808; 
  163. pascal void GetItemCmd(MenuHandle theMenu,short item,short *cmdChar)
  164.  = 0xA84E; 
  165. pascal void SetItemCmd(MenuHandle theMenu,short item,short cmdChar)
  166.  = 0xA84F; 
  167. pascal long PopUpMenuSelect(MenuHandle menu,short top,short left,short popUpItem)
  168.  = 0xA80B; 
  169. pascal long MenuChoice(void)
  170.  = 0xAA66; 
  171. pascal void DelMCEntries(short menuID,short menuItem)
  172.  = 0xAA60; 
  173. pascal MCTableHandle GetMCInfo(void)
  174.  = 0xAA61; 
  175. pascal void SetMCInfo(MCTableHandle menuCTbl)
  176.  = 0xAA62; 
  177. pascal void DispMCInfo(MCTableHandle menuCTbl)
  178.  = 0xAA63; 
  179. pascal MCEntryPtr GetMCEntry(short menuID,short menuItem)
  180.  = 0xAA64; 
  181. pascal void SetMCEntries(short numEntries,MCTablePtr menuCEntries)
  182.  = 0xAA65; 
  183. MenuHandle newmenu(short menuID,char *menuTitle); 
  184. void getitem(MenuHandle menu,short item,char *itemString); 
  185. void appendmenu(MenuHandle menu,char *data); 
  186. void insmenuitem(MenuHandle theMenu,char *itemString,short afterItem); 
  187. long menuselect(Point *startPt); 
  188. void setitem(MenuHandle menu,short item,char *itemString); 
  189. #ifdef __cplusplus
  190. }
  191. #endif
  192.  
  193. #endif
  194.